Release 10.1A: OpenEdge Development:
Programming Interfaces
Options for shared library routine declarations
In the syntax, the
proc-namevalue is the name of your shared library routine. TheEXTERNALoption indicates that the procedure being declared is an internal procedure implemented by an external shared library routine. Thedllnamevalue is the name of the shared library file that contains the routine.If you specify the
PERSISTENToption, the entire shared library remains loaded until Progress exits, or until you explicitly unload the shared library by using the 4GLRELEASE EXTERNALstatement.Each
parameter-definitionvalue consists of aDEFINE PARAMETERstatement. This is the syntax you must use for theDEFINEPARAMETERstatement in a DLL routine declaration:
Each
DEFINEPARAMETERstatement specifies anINPUT,OUTPUT, orINPUT-OUTPUTparameter in the order it appears in the calling sequence of your shared library routine. You can also (optionally) define oneRETURNparameter that provides the function return value of your shared library routine.The parameter name (
parameter) serves only as a place holder, and can take any unique identifier value. TheASdatatypeandLIKEfieldoptions require a special set of data types for shared library parameter definitions. These are described in the following section.Windows DLL calling conventions
The
PROCEDUREstatement lets you specify the calling convention — C, Pascal, or standard—that your DLL requires. The default is the standard calling convention. Many Windows functions use the standard calling convention. Windows functions that take a variable number of arguments, such aswsprintf(), often use the C calling convention. For more information on the C, Pascal, and standard calling conventions, see the Microsoft C Language Reference . For more information on the calling convention that a particular Windows function requires, see the Microsoft Windows Programmer’s Reference . Table 12–1 shows how to specify calling conventions.
Table 12–1: DLL calling conventions To specify this calling convention... Code this option... C C Pascal PASCAL Standard STDCALL
You can alternatively specify the DLL entry point by number with the
ORDINALnoption, wherenis the ordinal number of the entry point in the library. If you specify the entry point by number,proc-namecan have any unreserved identifier value, but you must use the same value for theRUNstatement that executes the DLL routine.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |